package com.nwcl.ysx.request;


import com.nwcl.common.request.BaseRequest;
import com.nwcl.common.result.Result;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;

/**
 * @author liguiqin
 * @date 2023/5/24
 */

public class PayRequest implements BaseRequest {
    private BigDecimal price;
    private String body;
    private String orderCode;

    @Override
    public Result check() {
        if (null == price) {
            return Result.fail("订单金额不能为空");
        }
        if (StringUtils.isBlank(body)) {
            return Result.fail("body说明不能为空");
        }
        if (StringUtils.isBlank(orderCode)) {
            return Result.fail("订单号不能为空");
        }
        return null;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }
}
